#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 100;
int T, n, a, b;
int f[N];

int solve() {
    int ans = 0;
    for (int i = 4e5;i >= 1;i--) {
        int t = 0;
        if (f[i]) continue;
        int num = 0;
        int g = 0;
        for (int j = i * 2;j <= N;j += i) {
            if (f[j]) {
                if (num == 0) {
                    g = j / i;
                }
                else {
                    g = gcd(g, j / i);
                }
                num++;
            }
        }
        if (num >= 2 && g == 1) {
            f[i] = 1;
            ans++;
        }
    }
    return ans;
}
int main() {
    cin >> n;
    for (int i = 1;i <= n;i++) {
        cin >> a;
        f[a] = 1;
    }

    cout << solve() << endl;
    return 0;
}